<?php

namespace App\Http\Controllers\Api\V1\Resources;

use App\Models\BuyerNotice;
use Illuminate\Http\Resources\Json\JsonResource;

class GoldChargeResource extends JsonResource
{
    public function toArray($request)
    {
    	$resource = $this->resource;
    	
        $data = [
	        'id' => (int)$resource->id,
	        'user_id' => (int)$resource->user_id,
	        'number' => $resource->number,
	        'total_amount' => $resource->total_amount,
	        'status' => $resource->status,
	        'is_paid' => $resource->isPaid(),
	        'paid_at' => (string)$resource->paid_at,
	        'created_at' => (string)$resource->created_at,
        ];
        
        return $data;
    }
}
